package com.sansan.qiangji.service.impl.system;

import com.sansan.qiangji.entity.system.Role;
import com.sansan.qiangji.mapper.system.RoleMapper;
import com.sansan.qiangji.service.inter.system.RoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {
    private RoleMapper roleMapper;

    @Resource
    public void setRoleMapper(RoleMapper roleMapper) {
        this.roleMapper = roleMapper;
    }

    @Override
    public List<Role> roleList(Role role) {
        return roleMapper.roleList(role);
    }

    @Override
    public Role findByRoleId(Integer roleId) {
        return roleMapper.findByRoleId(roleId);
    }

    @Override
    public List<Role> findByRoleName(String roleName) {
        return roleMapper.findByRoleName(roleName);
    }

    @Override
    public int addRole(Role role) {
        return roleMapper.addRole(role);
    }

    @Override
    public int updateRole(Role role) {
        return roleMapper.updateRole(role);
    }

    @Override
    public int deleteById(Integer roleId) {
        return roleMapper.deleteById(roleId);
    }
}
